home *** CD-ROM | disk | FTP | other *** search
/ PC World Interactive 7 / PC World Interactive 7.iso / online / gchess.EXE / CREATE.C < prev    next >
C/C++ Source or Header  |  1995-02-22  |  4KB  |  106 lines

  1. /*
  2.   C source for GNU CHESS
  3.  
  4.   Revision: 1990-09-30
  5.  
  6.   Modified by Daryl Baker for use in MS WINDOWS environment
  7.  
  8.   This file is part of CHESS.
  9.  
  10.   CHESS is distributed in the hope that it will be useful, but WITHOUT ANY
  11.   WARRANTY.  No author or distributor accepts responsibility to anyone for
  12.   the consequences of using it or for whether it serves any particular
  13.   purpose or works at all, unless he says so in writing.  Refer to the CHESS
  14.   General Public License for full details.
  15.  
  16.   Everyone is granted permission to copy, modify and redistribute CHESS, but
  17.   only under the conditions described in the CHESS General Public License.
  18.   A copy of this license is supposed to have been given to you along with
  19.   CHESS so you can know your rights and responsibilities.  It should be in a
  20.   file named COPYING.  Among other things, the copyright notice and this
  21.   notice must be preserved on all copies.
  22. */
  23.  
  24. #define NOATOM 
  25. #define NOCLIPBOARD
  26. #define NOCREATESTRUCT
  27. #define NOFONT
  28. #define NOREGION
  29. #define NOSOUND
  30. #define NOWH
  31. #define NOWINOFFSETS
  32. #define NOCOMM
  33. #define NOKANJI
  34.  
  35. #include <windows.h>
  36. #include <stdio.h>
  37.  
  38. #include "defs.h"
  39. #include "chess.h"
  40.  
  41. extern HWND hComputerColor;
  42. extern HWND hComputerMove;
  43. extern HWND hWhosTurn;
  44. extern HWND hClockComputer;
  45. extern HWND hClockHuman;
  46. extern HWND hMsgComputer;
  47. extern HWND hMsgHuman;
  48.  
  49.  
  50. void Create_Children ( HWND hWnd, HANDLE hInst, short xchar, short ychar)
  51. {
  52.    POINT pt;
  53.    static char lpStatic[] = "Static";
  54.  
  55.    /* Get the location of lower left conor of client area */
  56.    QueryBoardSize ( &pt);
  57.    
  58.             hComputerColor = CreateWindow (lpStatic,
  59.                          NULL,
  60.                          WS_CHILD | SS_CENTER | WS_VISIBLE,
  61.                          0,
  62.                          pt.y,
  63.                          10*xchar,
  64.                          ychar,
  65.                            hWnd, (HMENU)1000, hInst, NULL);
  66.  
  67.          hWhosTurn = CreateWindow (lpStatic,
  68.                          NULL,
  69.                          WS_CHILD | SS_CENTER | WS_VISIBLE,
  70.                          10*xchar,
  71.                          pt.y,
  72.                          10*xchar,
  73.                          ychar,
  74.                          hWnd, (HMENU)1001, hInst, NULL);
  75.  
  76.          hComputerMove = CreateWindow (lpStatic,
  77.                          NULL,
  78.                          WS_CHILD | SS_LEFT | WS_VISIBLE,
  79.                          375 /*0*/,
  80.                          10 /*pt.y+(3*ychar)/2*/,
  81.                          10*xchar,
  82.                          ychar,
  83.                            hWnd, (HMENU)1003, hInst, NULL);
  84.  
  85.  
  86.          hClockComputer =  CreateWindow ( lpStatic, NULL,
  87.                          WS_CHILD | SS_CENTER | WS_VISIBLE,
  88.                         390, 55, 6*xchar, ychar, hWnd,
  89.                         (HMENU)1010, hInst, NULL);
  90.  
  91.          hClockHuman =  CreateWindow ( lpStatic, NULL,
  92.                          WS_CHILD | SS_CENTER | WS_VISIBLE,
  93.                         390, 55+3*ychar, 6*xchar, ychar, hWnd,
  94.                         (HMENU)1011, hInst, NULL);
  95.  
  96.          hMsgComputer = CreateWindow ( lpStatic, "Black:",
  97.                          WS_CHILD | SS_CENTER | WS_VISIBLE,
  98.                         390, 55-3*ychar/2, 6*xchar, ychar, hWnd,
  99.                         (HMENU)1020, hInst, NULL);
  100.  
  101.          hMsgHuman    = CreateWindow ( lpStatic, "White:",
  102.                           WS_CHILD | SS_CENTER | WS_VISIBLE,
  103.                         390, 55+3*ychar/2, 6*xchar, ychar, hWnd,
  104.                         (HMENU)1021, hInst, NULL);
  105. }
  106.